import { createRouter, createWebHashHistory } from 'vue-router';
import ComingSoon from "../views/ComingSoon.vue";
import NowPlaying from "../views/NowPlaying.vue";
import Myfilm from "../views/MyFilm.vue";
import MyNews from "../views/MyNews.vue";
import MyCinema from "../views/MyCinema.vue";
import MyCenter from '../views/MyCenter.vue';
import MyDetial from "../views/Detail/MyDetail.vue";
import MyCitys from "../views/MyCitys.vue";
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect: "/film"
        },
        {
            path: '/film',
            name: 'film',
            component: Myfilm,
            redirect: '/film/nowplaying',
            //使用嵌套路由，来进行定位
            children: [
                {
                    path: 'nowplaying',
                    component: NowPlaying
                },
                {
                    path: 'comingsoon',
                    component: ComingSoon
                }
            ]
        },
        {
            path: '/detial/:id',
            name: 'detial',
            component: MyDetial
        },
        {
            path: '/news',
            name: 'news',
            component: MyNews
        },
        {
            path: '/cinema/:cid?/:cname?',
            name: 'cinema',
            component: MyCinema
        },
         {
            path: '/citys',
            name: 'citys',
            component: MyCitys
        },
        {
            path: '/center',
            name: 'center',
            component: () => import(/* webpackChunkName: "about" */ '../views/MyCenter.vue')
        },
       

    ]
});
export default router